package com.zebra.base.exception;

import com.zebra.base.msgcode.MsgCode;
import com.zebra.base.msgcode.SysErrorCode;

import javax.lang.model.type.ErrorType;

/**
 * @ClassName ZebraException
 * @Description TODO Exception 错误基类
 * @Author 消魂钉
 * @Date 6/1 0001 11:27
 */
public abstract class ZebraException extends RuntimeException{

    /**
     * 异常对应的错误类型
     */
    private final MsgCode errorCode;

    /**
     * 默认的系统异常信息
     */
    public ZebraException(){
        this.errorCode = SysErrorCode.ERROR;
    }

    public ZebraException(MsgCode errorCode, String message){
        super(message);
        this.errorCode = errorCode;
    }

    public ZebraException(MsgCode errorCode, String message, Throwable cause) {
        super(message, cause);
        this.errorCode = errorCode;
    }

    public MsgCode getErrorCode() {
        return errorCode;
    }
}
